<?php

class Users_ReadAction extends SrsUsersBaseAction
{
	public function getCredentials()
	{
		return 'users.read';
	}

	public function executeRead(AgaviRequestDataHolder $rd)
	{
		$user = Doctrine_Query::create()
		        ->from('User')
			      ->where('id=?', array($rd->getParameter('id', 0)))
		        ->fetchOne();

		if (!$user instanceof User) return $this->forward404();

		$this->setAttribute('user', $user);

		return 'Success';
	}
}